public class SimpleGenericExample2 {

  public static void main(String[] args) {

    SimpleGeneric<String, Integer> sample = new SimpleGeneric<>("Hello World", 100);
    sample.printTypes();
  }
}


class SimpleGeneric<U, V> {

  private U object1;
  private V object2;

  public SimpleGeneric(U object1, V object2) {
    this.object1 = object1;
    this.object2 = object2;
  }

  public void printTypes() {
    System.out.println("U Type: " + this.object1.getClass().getName());
    System.out.println("V Type: " + this.object2.getClass().getName());
  }
}
